This application claims the priority of Korean Patent Application No. 2003-92523, filed on Dec. 17, 2003, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
The present invention relates to a socket compatibility layer for TCP/IP offload engine (‘TOE’), and more particularly to a socket compatibility layer for TOE which can support a simultaneous use of a TOE and Ethernet-based network interface card (‘NIC’) in a high quality server system using the TOE.
2. Description of the Related Art
Typically, a TCP/IP stack is processed by software in a central processing unit of a server. However, as a network is developed to a gigabit network, processing of a TCP/IP protocol imposes a heavy burden on the central processing unit. Therefore, the performance of other application programs processed in a host processor may be deteriorated.
A TOE is developed to solve the above problem and a TCP/IP protocol is processed by dedicated hardware. The dedicated hardware processing the TCP/IP protocol is used, so that the burden of a host processor can be reduced. Therefore, the performance of an application program can be improved.
FIG. 1 is a diagram showing a simple comparison of a case using a general NIC and a case using a TOE.
As compared with the case (left side) using the general NIC, in the case (right side) using the TOE, a TCP layer and an IP layer are embedded in hardware. That is, the protocols are processed by the hardware. When a server of high performance transmits/receives a large quantity of data to a network, load on a host processor can be reduced by using the TOE.
However, in order to the TOE in the prior art, a standard socket API cannot be used in an application program or an already created application program must be modified and recompiled.
FIG. 2 is a diagram showing a TOE support structure which does not support the conventional standard socket API.
Hereinafter, the conventional software structure for a TOE will be described. In FIG. 2, an application program 10 must use a TOE API 21 which is a special API for a TOE in order to use a networking function of a TOE 20. Further, an already created socket application program must be recreated and recompiled so as to use the TOE API 21.
Further, another software structure for a TOE may exist, in this case, in spite of providing a standard socket API 11 to an application program, binary-level compatibility is not provided. FIG. 3 shows such a case.
FIG. 3, a plurality of protocol family types exist below a BSD socket layer 30. Herein, one protocol family corresponding to TOE is added, which allows a user to access the TOE 20 using the standard socket API 11. Further, in order to use a networking function of the TOE 20, a system call must be performed by means of a protocol family identifier of a TOE. In such a case, the application program 10 may use the standard socket API 11, but the already created socket application program must be modified and recompiled with corresponding protocol family identifier. Therefore, this means that binary-level compatibility for the existing socket application program is not provided.
Accordingly, in order to use the TOE 20 more efficiently, it is necessary to provide binary-level compatibility so that an application can use the standard socket API 11 and an existing application program can be used without modification and recompilation.
Hereinafter, a main data structure relating to a socket in the conventional kernel will be briefly described. FIG. 4 is a diagram showing the main data structure relating to the socket in the conventional kernel.
In FIG. 4, the uppermost BSD socket layer 30 is a layer for providing a BSD socket interface to the application program 10 and an INET socket layer 40 managing communication of IP based protocols exists below the BSD socket layer 30. Further, a TCP layer 50 taking charge of a TCP and a UDP exists below the INET socket layer 40.
The BSD socket layer 30 includes a socket generation module head 31, a BSD socket 32 and a BSD module unit 33. The socket generation module head 31 is a connection point to a socket generation module generating a socket of a lower protocol stack, and the BSD socket 32 contains plural information, such as a state and a type of a socket and a socket-related file, which is necessary for a BSD layer. The BSD module unit 33 provides a socket interface to the application program 10 and calls a module of a lower layer.
Further, the INET socket layer 40 includes an INET socket generation module 41, an INET socket 42, an INET STREAM module unit 43 and an INET DGRAM module unit 44. The INET socket generation module 41 generates an INET socket. The INET socket 42 contains plural information, such as an IP address of a destination, a port number and a wait queue, which is necessary for an INET layer. The INET STREAM module unit 43 is a set of modules processing an operation for a SOCK_STREAM type socket and the INET DGRAM module unit 44 is a set of modules processing an operation for a SOCK_DGRAM type socket.
The TCP layer 50 includes a TCP module unit 51 which is a set of modules processing a TCP protocol and a UDP module unit 52 which is a set of modules processing a UDP protocol.
To solve the aforementioned problems occurring in using the conventional TOE, it is necessary to modify the data structure relating to the socket in the conventional kernel. In the present invention, a socket compatibility layer for a TOE is realized with only a kernel module without modifying the codes of the conventional kernel.